<?php
/**
 * Base class for page blocks
 * @author Kirill A Egorov 2011 DVelum project
 */
abstract class Block_Abstract{
	/**
	 * Block config
	 * @var array
	 */
	protected $_config;
	/**
	 * Block tamplate. The path is relative to theme location
	 * @var string
	 */
	protected $_template = 'block.php';
	
	/**
	 * @var Lang
	 */
	protected $_lang;
	
	/**
	 * Block constructur
	 * @param array $config - block config
	 */
	public function __construct(array $config){
		$this->_config = $config;
		$this->_lang = Lang::getInstance();
	}
	/**
	 * Render block content
	 * @return string
	 */
	abstract public function render();
	/**
	 * String representation for object
	 * Returns rendered html
	 * @return string
	 */
	public function __toString(){
		return $this->render();
	}
}